<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCaseEventsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('case_events', function (Blueprint $table) {
            $table->increments('id');
            $table->string('content')->default('')->comment('内容');
            $table->integer('case_customer_id')->comment('所属客户');
            $table->integer('case_contact_id')->nullable()->comment('联系人');
            $table->integer('case_contract_id')->nullable()->comment('所属合同');
            $table->integer('case_opportunity_id')->nullable()->comment('所属商机');
            $table->integer('admin_user_id')->comment('跟进者');
            $table->date('reminder')->nullable()->comment('提醒');
            $table->integer('case_batch_id')->nullable()->comment('所属批次');
            $table->integer('case_case_id')->nullable()->comment('所属案件');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('case_events');
    }
}
